package com.zoweunion.mechanic.service.order;

import com.zoweunion.mechanic.entity.OrderExportBean;
import com.zoweunion.mechanic.model.User;
import com.zoweunion.mechanic.util.MyException;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;

public interface KFOrderService {

	/**
	 * 分页条件查询
	 * @param reqMap
	 * @return
	 */
	Map<String, Object> listByStatus(Map<String, Object> reqMap);

	/**
	 * 获取故障列表
	 * @param reqMap
	 * @return
	 */
	List<Map<String, Object>> getfaultList(Map<String, Object> reqMap);

	/**
	 * 创建总工单
	 * @param reqMap
	 * @return
	 */
	String createOrder(Map<String, Object> reqMap) throws MyException;


	/**
	 * 按角色类型根据规则自动分配人员(听诊)的userId
	 * @param reqMap
	 * @return
	 */
	String autoGetOrderUserId(Map<String, Object> reqMap);


	/**
	 * 按角色类型根据规则自动分配修工的userId
	 * @param reqMap
	 * @return
	 */
	String autoGetXgUserId(Map<String, Object> reqMap);


	/**
	 * 自动分配工单仓库
	 * @param reqMap
	 * @return
	 */
	public void autoOrderWareHouse(Map<String, Object> reqMap);

	/**
	 * 更新总工单
	 * @param reqMap
	 * @return
	 */
	int updateOrderInfo(Map<String, Object> reqMap);

	/**
	 * 获取工单详情
	 * @param reqMap
	 * @return
	 */
	Map<String, Object> getOrderInfo(Map<String, Object> reqMap);

	/**
	 * 投诉工单列表 条件分页查询
	 * @param reqMap
	 * @return
	 */
	Map<String, Object> complaintHandleList(Map<String, Object> reqMap);


	/**
	 * 根据order_id查询投诉工单详情
	 * @param reqMap
	 * @return
	 */
	Map<String, Object> getComplaintHandleInfoByOrder_id(Map<String, Object> reqMap);

	/**
	 * 更新Complaint_handle 记录
	 * @param reqMap
	 * @return
	 */
	int updateComplaint_handle(Map<String, Object> reqMap);


	List<Map<String, Object>> readExcel(MultipartFile file) throws MyException;

	/**
	 * 记录授权日志
	 */
	int insertAuthLog(Map<String, Object> map);

	/**
	 * 打折更改配件价格
	 */
	int updatePartsPrice(String p_id, String price, String discount_price, String order_id);

	/**
	 * 客服获取可优惠工单
	 * @param map
	 */
	Map<String, Object> getDiscountOrderList(Map<String, Object> map);

	/**
	 * 根据客服选择的可优惠的配件信息筛选出相应的工单,然后推送给高管
	 * @param order_id
	 */
	Map<String, Object> getDiscountOrderListByParts(String parts, String order_id);

	int handleFlag(Map<String, Object> resultMap);

	List<Map<String, Object>> getOrderDetail(String order_id);

	List<Map<String, Object>> getOrderPartsDetail(String order_id);

	List<Map<String, Object>> getDiscountOrderInfo(String order_id);
	/**
	 * 高管获取可优惠工单
	 * @param map
	 */

	Map<String, Object> getGgDiscountOrderList(Map<String, Object> map);

	List<Map<String, Object>> getOrderInfoByOrderId(String order_id);

	List<Map<String, Object>> findUserByRid(Map<String, Object> reqMap);

	List<String> findXgId(Map<String, Object> reqMap);

	/**
	 * 获取工单配件列表
	 */
	Map<String, Object> detailPartsInfo(Map<String, Object> reqMap);

	/**
	 * 获取车主列表
	 * @param reqMap
	 * @return
	 */
	List<Map<String, Object>> listCarMaster(User currentUser, Map<String, Object> reqMap);

    List<OrderExportBean> exportHistoryList(Map<String, Object> params);
}
